-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable exporting (registered) submission metadata #4962
Enable exporting (registered) submission metadata #4962
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4962 +/- ##
==========================================
+ Coverage 96.64% 96.65% +0.01%
==========================================
Files 760 762 +2
Lines 25844 25935 +91
Branches 3387 3391 +4
==========================================
+ Hits 24976 25067 +91
Misses 604 604
Partials 264 264 ☔ View full report in Codecov by Sentry. |
def export(self) -> Dataset: | ||
start_date: date = self.cleaned_data["start_date"] | ||
end_date: date = self.cleaned_data["end_date"] | ||
return export_registration_statistics( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a bit picky, but why do you define the dates as variables? Is it (only) to specify the date typing?
Otherwise, why not just pass the cleaned_data
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of reasons, all summarized as "loose coupling".
- A simple
export_registration_statistics
with plain parameters is easy to understand when you're in that function, without adding the cognitive overhead of knowing what the form structure looks like and what's incleaned_data
. - Building on top of 1., I can modify my form implementation and interface without needing to touch the actual export function. If I have to touch the export function, I'm very well aware that I'm changing a Python API and need to check for possible other call sites.
- The export function can also be called through other user interfaces, e.g. a management command/CLI where the date parameters get passed/parsed differently, or a celery task could be wired up to periodically generate these and automatically prepare/send the exports.
- Explicit type annotations are nice indeed :)
I've tried the export, and was missing some submissions.. I'm not yet sure why, i'll take another look later today.. |
Export submission statistics based on the timeline logs. Note: if the timeline logs are pruned, this affects the exports. It's up to the users to periodically create these exports and save them somewhere if they periodically prune log records. Note 2: filtering on forms only works on new log records, as existing log records don't have the form ID stored in the structured data. Submissions that were deleted for which existing log records are present will display 'unknown' for some columns because the relevant information has been deleted. Only from 3.0 onwards are we snapshotting the data required for the exports.
Ensures that the filters are correctly implemented.
5627a76
to
d8b516e
Compare
Closes #4930
Changes
Checklist
Check off the items that are completed or not relevant.
Impact on features
Release management
I have updated the translations assets (you do NOT need to provide translations)
./bin/makemessages_js.sh
./bin/compilemessages_js.sh
Dockerfile/scripts
./bin
folderCommit hygiene